home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games: 500 MB Amiga Software
/
500 MB Amiga Software - Euber 130 - Amiga Games Disc & Mag.iso
/
userbox
/
publicdomain
/
tinymeter
/
source
/
tinymeter_main
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-16
|
3KB
|
204 lines
#include "includes.h"
#include "structs.h"
#include <libraries/commodities.h>
int __nocommandline=1;
struct tm_settings dftm =
{
1L,
20L,
256L,
0L,
3,
7,
1,
1,
0,
1,
"topaz.font",
8,
TRUE,
FALSE,
"",
"",
0,
0,
0,
0,
0,
1,
0,
0,
1,
"Chip",
"Fast",
"Retina",
"Virtual",
0,
FALSE,
0,
0,
8,
5,
8,
FALSE,
"%td Bytes free",
FALSE,
TRUE,
TRUE,
"Memory",
"%tlc | %tlf",
"%tc | %tf",
FALSE,
FALSE,
TRUE,
0,
"%tkd KB, %p%% free",
10,
TRUE,
TRUE,
0,
0,
"TinyMeter_DIGITAL.font",
17,
"TinyMeter_DIGITAL.font",
11,
0,
1,
0,
0,
FALSE,
TRUE,
2,
"Idle",
"%p %% free",
0,
FALSE,
FALSE
};
struct Library *ShutdownBase;
struct Library *RetinaBase;
struct Library *TimerBase;
ULONG bas_c_ram,
bas_f_ram,
act_c_ram,
act_f_ram,
all_c_ram,
all_f_ram,
all_r_ram,
bas_r_ram,
act_r_ram,
all_o_ram[32],
bas_o_ram[32],
act_o_ram[32],
bas_idle;
extern struct WBStartup *_WBBenchMsg;
extern struct Library *CxBase;
extern struct Library *DataTypesBase;
extern ULONG idle,maximum;
extern BOOL InitIdle;
struct NewBroker newbroker =
{
NB_VERSION,
"TinyMeter V3.62",
"TinyMeter V3.62 © by Tinic Urou",
"Shows memory-&volumesusage, date&time",
NBU_UNIQUE,
0,
-3,
0,
0
};
int main(void)
{
ULONG cxsigflag;
UBYTE *my_file;
CxMsg *msg;
CxObj *broker;
struct MsgPort *broker_mp;
char *version="$VER: TinyMeter V3.62";
SetTaskPri(FindTask(0L),-3);
if(broker_mp = (struct MsgPort *)CreatePort(0,0))
{
newbroker.nb_Port = (struct MsgPort *)broker_mp;
if (broker = (CxObj *)CxBroker(&newbroker, NULL))
{
cxsigflag = 1L << broker_mp->mp_SigBit;
ActivateCxObj(broker, 1L);
if(my_file=(UBYTE *)Open("ENV:TinyMeter",MODE_OLDFILE) )
{
Read(my_file,&dftm,(ULONG)sizeof(struct tm_settings));
Close(my_file);
if(dftm.VolRefreshTime==0) dftm.VolRefreshTime=10;
if(dftm.colums<1) dftm.colums=1;
}
if(RetinaBase=(struct Library *)OpenLibrary("retina.library",0L)) all_r_ram=Retina_AvailMem(MEMF_TOTAL)+256L; else all_r_ram=256L;
all_c_ram=AvailMem( MEMF_TOTAL | MEMF_CHIP )+256L;
all_f_ram=AvailMem( MEMF_TOTAL | MEMF_FAST )+256L;
Delay(dftm.WaitSeconds*50);
makeall();
intui_handler(broker_mp,broker,cxsigflag);
free_all();
if(InitIdle)
{
free_idle();
InitIdle=FALSE;
}
if(RetinaBase)CloseLibrary( RetinaBase );
DeleteCxObj(broker);
while(msg = (CxMsg *)GetMsg(broker_mp)) ReplyMsg((struct Message *)msg);
}
DeletePort(broker_mp);
}
}